import React from "react";
import { HashRouter, Link, Switch, Route } from "react-router-dom";
import App from "./App";
import Login from "./pages/login";
import Admin from "./admin";
import Buttons from "./pages/ui/buttons";
import NoMatch from "./pages/nomatch/index";
import Modals from "./pages/ui/modals";
import Loading from "./pages/ui/loadings";
import Notice from "./pages/ui/notice"
import Message from './pages/ui/message'
import Tab from './pages/ui/tabs'
import Gallery from './pages/ui/gallery'
import Carousel from './pages/ui/carouse'
import NormalLoginForm from './pages/form/login'
import Reg from './pages/form/register'
import basicTable from './pages/table/basicTable'
import highTable from './pages/table/highTable'
import Rich from './pages/rich/index'
import City from './pages/city/index'

export default class IRouter extends React.Component {
  render() {
    return (
      <HashRouter>
        <App>
          <Route path="/login" component={Login} />
          <Route
            path="/admin"
            render={() => (
              <Admin>
                <Route path="/admin/ui/buttons" component={Buttons} />
                <Route path="/admin/ui/modals"  component={Modals} />
                <Route path="/admin/ui/loadings"  component={Loading} />
                <Route path='/admin/ui/notification' component={Notice}/>
                <Route path='/admin/ui/messages' component={Message}/>
                <Route path="/admin/ui/tabs" component={Tab}></Route>
                <Route path="/admin/ui/gallery" component={Gallery}/>
                <Route path="/admin/ui/carousel" component={Carousel}/>
                <Route path="/admin/form/login" component={NormalLoginForm}/>
                <Route path="/admin/form/reg" component={Reg}/>
                <Route path="/admin/table/basic" component={basicTable}/>
                <Route path="/admin/table/high" component={highTable}/>
                <Route path="/admin/rich" component={Rich}/>
                <Route path="/admin/city" component={City}/>




                <Route component={NoMatch} />
              </Admin>
            )}
          />
          <Route path="/order/detail" component={Login} />
        </App>
      </HashRouter>
    );
  }
}
